<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="dao.ContentsDAO"%>
<%@ page import="entity.Contents" %>
<%@ page import="java.sql.*,java.util.*"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<base href="<%=basePath%>">
<title></title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>
</head>
<body>
<hr>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 审批列表</strong></div>

  <table class="table table-hover text-center">
  <tr>
    <td width="10%">合同编号</td>
    <td width="10%">合同名称</td>
    <td width="10%">合同金额</td>
    <td width="10%">主要条款</td>
    <td width="15%">履行起始时间</td>
    <td width="15%">履行结束时间</td>
    <td width="10%">附件</a></td>
    <td width="20%">操作</td>
  </tr>
  <%
  ContentsDAO contentsdao = new ContentsDAO();
  List<Contents> list =contentsdao.loadAllContents();

  if(list!=null&&list.size()>0){
		for(int i=0;i<list.size();i++)
		{
			Contents ex= list.get(i);
%>

  
  <tr>
    <td><%=ex.getCno()%></td>
    <td><%=ex.getCname()%></td>
    <td><%=ex.getCprice()%></td>
    <td><%=ex.getMclause()%></td>
    <td><%=ex.getCstart()%></td>
    <td><%=ex.getCend()%></td>
    <td><a target="_blank" href="<%=path%>/upload/<%=ex.getOther()%>"><%=ex.getOther()%></a></td>
    <td><div class="button-group"> <a class="button border-main" href="servlet/CheckServlet?action=edit&cno=<%=ex.getCno()%>" onclick="javascript:return pass()"><span class="icon-edit"></span> 通过</a> 
    <a class="button border-red" href="servlet/CheckServlet?action=delt&cno=<%=ex.getCno()%>" onclick="javascript:return del()"><span class="icon-trash-o"></span> 删除</a> </div></td>
  </tr>

<%
                        }
        }
                %>
  </table>
  </div>
 <script type="text/javascript">
 function pass() { 
	 var msg = "您确定要通过吗？\n\n请确认！"; 
	 if (confirm(msg)==true){ 
	  return true; 
	 }else{ 
	  return false; 
	 } 
	} 
 function del() { 
	 var msg = "您真的确定要删除吗？\n\n请确认！"; 
	 if (confirm(msg)==true){ 
	  return true; 
	 }else{ 
	  return false; 
	 } 
	} 
</script> 
</body>
</html>
